import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { SMSChannelService } from '../service/sms-channel.service';
import { SendSmsRequestDto } from '../dto/sendSmsRequest.dto';

@Controller('/channel/sms')
export class SMSChannelController {
  constructor(private readonly smsChannelService: SMSChannelService) {}

  @Post()
  @HttpCode(200)
  async sendSMS(@Body() sendSmsRequest: SendSmsRequestDto): Promise<boolean> {
    return this.smsChannelService.sendSMS(
      sendSmsRequest.to,
      sendSmsRequest.content,
    );
  }
}
